home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / libs / sphigs / sph_mac.hqx / SRGP port to 5.0 (compressed) / SRGP_SPHIGS Root / MacSPHIGS / sph_utility.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-02-13  |  1.2 KB  |  68 lines

  1. #include "HEADERS.h"
  2. #include "sphigslocal.h"
  3.  
  4. #include "sph_utility.proto.h"
  5.  
  6. /** Functions creating geometric data 
  7. **/
  8.  
  9. double *SPH_defPoint (double *pt, double x, double y, double z)
  10. {
  11.    pt[0] = x;
  12.    pt[1] = y;
  13.    pt[2] = z;
  14.    return pt;
  15. }
  16.  
  17.  
  18. NDC_rectangle SPH_defNDCrectangle (double left_x, double bottom_y, double right_x, double top_y)
  19. {
  20.    NDC_rectangle rect;
  21.  
  22.    rect.bottom_left.x = left_x;
  23.    rect.bottom_left.y = bottom_y;
  24.    rect.top_right.x = right_x;
  25.    rect.top_right.y = top_y;
  26.    return rect;
  27. }
  28.  
  29.  
  30.  
  31.  
  32. /** INTERNAL UTILITIES
  33. The below functions perform operations on "intelligent rectangles":
  34.    SRGP rectangles that "know" whether they are empty.
  35.  
  36.  
  37.  
  38.             CURRENTLY   ALL     COMMENTED   OUT
  39.  
  40. void
  41. SPH_clip_intelligent_rectangle (ir, sr)
  42. intelligent_rectangle *ir;
  43. srgp__rectangle sr;
  44. {
  45.    if (ir->nonempty) {
  46.       if (GEOM_computeRectIntersection (ir->rect, sr, &(ir->rect)))
  47.      ir->nonempty = TRUE;
  48.       else
  49.      ir->nonempty = FALSE;
  50.    }
  51. }
  52.  
  53.  
  54.  
  55. void
  56. SPH_expand_intelligent_rectangle (ir, sr)
  57. intelligent_rectangle *ir;
  58. srgp__rectangle sr;
  59. {
  60.    if (ir->nonempty)
  61.       GEOM_computeRectUnion (ir->rect, sr, &(ir->rect));
  62.    else
  63.       ir->rect = sr;
  64.  
  65.    ir->nonempty = TRUE;
  66. }
  67.    **/
  68.